<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
	</head>
	<body>
		<div class="abc">
			<label for="name">用户名</label>
		    <input type="name" />
		    <br />
		    <label for="password">密码</label>
		    <input type="password" id="password" />
		    <br />
		    <button>登录</button>
		</div>
		
		<script type="text/javascript">
			function logIn(name,password){
				$.ajax({
					url:"https://web-gateway.newbeescm.com/b2b-app-web/user/login",
					data:{
						loginName:name,
						password:password
					}
				}).then(res=>{
//					localStorage.setItem("token",res.result.token);
//					localStorage.setItem("phone",res.result.phone);
//					window.location.href="../html/登录/html"
                    if(res.status.statusCode=1171500){
                    	window.location.href="home.html"
                    }
					console.log(res);
				}).catch(rej=>{
					conosle.log(rej);
				})
			}
			
		  $(function(){
		  	$("button").click(function(){
		  		var name=$("#name").val();
		  		var password=$("#password").val();
		  		logIn(name,password);
		  	})
		  })
		</script>
	</body>
</html>
